{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from requests_html import HTMLSession\n",
    "import requests_html\n",
    "import pandas as pd\n",
    "import urllib.parse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "200"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "session = HTMLSession()\n",
    "r = session.get(\"https://www.nfu.edu.cn/xydt/index.htm\")\n",
    "r.status_code"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 存\n",
    "with open (\"html_out/_nfu_xydt.html\", encoding = \"utf8\", mode = \"w\") as fp:\n",
    "    fp.write(r.html.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 读\n",
    "with open (\"html_out/_nfu_xydt.html\", encoding = \"utf8\", mode = \"r\") as fp:\n",
    "    html_load = fp.read()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Element html at 0x15f2d96e770>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 解析\n",
    "parsed = requests_html.soup_parse(html_load)\n",
    "parsed"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ParseResult(scheme='https', netloc='www.nfu.edu.cn', path='/xydt/index.htm', params='', query='', fragment='')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 解析\n",
    "base_url = r.url\n",
    "nfu_urlparse = urllib.parse.urlparse(base_url)\n",
    "nfu_urlparse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['https://www.nfu.edu.cn/xydt/7dfe6fcd15fd495597cbd282de863733.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/09627d3243ee4578ac69be2881abd8b3.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/debea203b0c84a3092e6b5416cc4c2f1.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/9ec16bf90e164071b68a57332c5fe020.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/cf4420785b9046e99851413a1fb1b6f7.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/16f4c5f4bd284caebfe79cd5d66e288b.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/935f580040704990a4e396fa8091ee30.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/9611d110ec8a486587ab4020171ee9f5.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/8b2414ee7cca45d88c4217dd13f8f8ec.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/a9523b72a34e4143afa9b38879ecba0c.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/f8434c9f092348c2a4a3c1ac8727a8fd.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/d60d33983337463390ef99385afce119.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/4b0c8e69b5074d28badd20cb55436009.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/bdda4dfbda944a3eb84612b7045620f4.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/96e05388e3fa43de9a8f446b083875f8.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/25dc7cb574284be18a6c9a0640e5aca3.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/b9777111c2194e7b85143431ab4706a7.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/2f3dcc0f4400419e8e42af09fde3c251.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/c3846031b4c0444a99e0dfd90047c046.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/5e165fdaee834899891ba5b3eea69bc9.htm']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 重组链接\n",
    "list_URL  = [urllib.parse.urlunparse\\\n",
    "([nfu_urlparse.scheme,nfu_urlparse.netloc,'/'+ nfu_urlparse.path.split('/')[1] +'/' + detail_url,'','',''])\\\n",
    "for detail_url in parsed.xpath('//div[@class=\"news_title\"]/a/@href')]  \n",
    "list_URL"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>标题</th>\n",
       "      <th>链接</th>\n",
       "      <th>日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>【国奖映像】苏绮筠：让优秀成为习惯</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/7dfe6fcd15fd495597...</td>\n",
       "      <td>2021-04-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>【国奖映像】陈宇：心怀热爱，奔赴梦想</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/09627d3243ee4578ac...</td>\n",
       "      <td>2021-04-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>护理与健康学院2020-2021第二学期团员培训课程第2讲圆满结束</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/debea203b0c84a3092...</td>\n",
       "      <td>2021-04-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>护理与健康学院2020-2021年度第二学期3月份团支部委员会顺利举行</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/9ec16bf90e164071b6...</td>\n",
       "      <td>2021-04-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>商学院电子商务专业召开申请调整学位授予学科门类 专家评审会</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/cf4420785b9046e998...</td>\n",
       "      <td>2021-04-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>会计学院大一年级大会顺利召开</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/16f4c5f4bd284caebf...</td>\n",
       "      <td>2021-04-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>广州新华学院会计学院刘运国院长一行莅临我院访问</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/935f580040704990a4...</td>\n",
       "      <td>2021-04-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>【国奖映像】蒋晓琳：明确目标，为之努力</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/9611d110ec8a486587...</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>励能计划2021：你选哪一项？</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/8b2414ee7cca45d88c...</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>党团同行传薪火，红色循迹筑初心——商学院党团同行重走“东江纵队”红色之路</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/a9523b72a34e4143af...</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>广州南方学院老年与慢病护理研究中心学术沙龙系列第3期圆满结束</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/f8434c9f092348c2a4...</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>凝心聚力 共谱新篇——商学院召开新学期全体教职工大会</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/d60d33983337463390...</td>\n",
       "      <td>2021-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>青马工程｜“回首峥嵘岁月，领悟红船精神”——商学院百年党史宣讲活动</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/4b0c8e69b5074d28ba...</td>\n",
       "      <td>2021-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>护理与健康学院“教学相长，从教学中成长”暨青年教师专题讲座与交流活动圆满结束</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/bdda4dfbda944a3eb8...</td>\n",
       "      <td>2021-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>党建观摩拓思路，对照标杆“取真经”——我校商学院师生团队赴广东外语外贸大学南国商学院管理学院...</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/96e05388e3fa43de9a...</td>\n",
       "      <td>2021-03-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>护理与健康学院直属党支部2021年春季入党积极分子培训圆满结束</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/25dc7cb574284be18a...</td>\n",
       "      <td>2021-03-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>成长在文传我院举行2021年春季学期全体教职工大会</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/b9777111c2194e7b85...</td>\n",
       "      <td>2021-03-29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>“远离糖尿病，筑起健康防线” 护理与健康学院寒假社会实践调查成果汇报展示圆满结束</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/2f3dcc0f4400419e8e...</td>\n",
       "      <td>2021-03-29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>倾心指导促研学，凝心聚力谋发展——大英中心教学研究座谈会顺利召开</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/c3846031b4c0444a99...</td>\n",
       "      <td>2021-03-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>护理与健康学院第37期师生面对面顺利开展</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/5e165fdaee83489989...</td>\n",
       "      <td>2021-03-26</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                   标题  \\\n",
       "0                                   【国奖映像】苏绮筠：让优秀成为习惯   \n",
       "1                                  【国奖映像】陈宇：心怀热爱，奔赴梦想   \n",
       "2                   护理与健康学院2020-2021第二学期团员培训课程第2讲圆满结束   \n",
       "3                 护理与健康学院2020-2021年度第二学期3月份团支部委员会顺利举行   \n",
       "4                       商学院电子商务专业召开申请调整学位授予学科门类 专家评审会   \n",
       "5                                      会计学院大一年级大会顺利召开   \n",
       "6                             广州新华学院会计学院刘运国院长一行莅临我院访问   \n",
       "7                                 【国奖映像】蒋晓琳：明确目标，为之努力   \n",
       "8                                     励能计划2021：你选哪一项？   \n",
       "9                党团同行传薪火，红色循迹筑初心——商学院党团同行重走“东江纵队”红色之路   \n",
       "10                     广州南方学院老年与慢病护理研究中心学术沙龙系列第3期圆满结束   \n",
       "11                         凝心聚力 共谱新篇——商学院召开新学期全体教职工大会   \n",
       "12                  青马工程｜“回首峥嵘岁月，领悟红船精神”——商学院百年党史宣讲活动   \n",
       "13             护理与健康学院“教学相长，从教学中成长”暨青年教师专题讲座与交流活动圆满结束   \n",
       "14  党建观摩拓思路，对照标杆“取真经”——我校商学院师生团队赴广东外语外贸大学南国商学院管理学院...   \n",
       "15                    护理与健康学院直属党支部2021年春季入党积极分子培训圆满结束   \n",
       "16                          成长在文传我院举行2021年春季学期全体教职工大会   \n",
       "17           “远离糖尿病，筑起健康防线” 护理与健康学院寒假社会实践调查成果汇报展示圆满结束   \n",
       "18                   倾心指导促研学，凝心聚力谋发展——大英中心教学研究座谈会顺利召开   \n",
       "19                               护理与健康学院第37期师生面对面顺利开展   \n",
       "\n",
       "                                                   链接          日期  \n",
       "0   https://www.nfu.edu.cn/xydt/7dfe6fcd15fd495597...  2021-04-09  \n",
       "1   https://www.nfu.edu.cn/xydt/09627d3243ee4578ac...  2021-04-09  \n",
       "2   https://www.nfu.edu.cn/xydt/debea203b0c84a3092...  2021-04-09  \n",
       "3   https://www.nfu.edu.cn/xydt/9ec16bf90e164071b6...  2021-04-09  \n",
       "4   https://www.nfu.edu.cn/xydt/cf4420785b9046e998...  2021-04-07  \n",
       "5   https://www.nfu.edu.cn/xydt/16f4c5f4bd284caebf...  2021-04-06  \n",
       "6   https://www.nfu.edu.cn/xydt/935f580040704990a4...  2021-04-06  \n",
       "7   https://www.nfu.edu.cn/xydt/9611d110ec8a486587...  2021-04-02  \n",
       "8   https://www.nfu.edu.cn/xydt/8b2414ee7cca45d88c...  2021-04-02  \n",
       "9   https://www.nfu.edu.cn/xydt/a9523b72a34e4143af...  2021-04-02  \n",
       "10  https://www.nfu.edu.cn/xydt/f8434c9f092348c2a4...  2021-04-02  \n",
       "11  https://www.nfu.edu.cn/xydt/d60d33983337463390...  2021-04-01  \n",
       "12  https://www.nfu.edu.cn/xydt/4b0c8e69b5074d28ba...  2021-04-01  \n",
       "13  https://www.nfu.edu.cn/xydt/bdda4dfbda944a3eb8...  2021-04-01  \n",
       "14  https://www.nfu.edu.cn/xydt/96e05388e3fa43de9a...  2021-03-30  \n",
       "15  https://www.nfu.edu.cn/xydt/25dc7cb574284be18a...  2021-03-30  \n",
       "16  https://www.nfu.edu.cn/xydt/b9777111c2194e7b85...  2021-03-29  \n",
       "17  https://www.nfu.edu.cn/xydt/2f3dcc0f4400419e8e...  2021-03-29  \n",
       "18  https://www.nfu.edu.cn/xydt/c3846031b4c0444a99...  2021-03-26  \n",
       "19  https://www.nfu.edu.cn/xydt/5e165fdaee83489989...  2021-03-26  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 输出结果\n",
    "# B-D-1 pd.DataFrame 建构，pandas课有教\n",
    "df = pd.DataFrame( {\n",
    "         \"标题\": parsed.xpath('//div[@class=\"news_title\"]/a/@title'),\n",
    "         \"链接\": list_URL,\n",
    "         \"日期\": parsed.xpath('//font[@class=\"right-more\"]/text()'),\n",
    "     } )\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_excel(\"data_out/nfu_xydt.xlsx\", sheet_name=\"检索结果\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "200\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n",
      "404\n"
     ]
    }
   ],
   "source": [
    "for i in range(1,100):\n",
    "    r = session.get('https://www.nfu.edu.cn/xydt/index'+str(i)+'.htm')\n",
    "    print(r.status_code)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "85\n"
     ]
    }
   ],
   "source": [
    "for i in range(1,100):\n",
    "    r = session.get('https://www.nfu.edu.cn/xydt/index'+str(i)+'.htm')\n",
    "    if r.status_code != 200:\n",
    "        print(i)\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['https://www.nfu.edu.cn/xydt/index1.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index2.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index3.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index4.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index5.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index6.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index7.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index8.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index9.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index10.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index11.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index12.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index13.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index14.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index15.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index16.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index17.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index18.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index19.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index20.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index21.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index22.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index23.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index24.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index25.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index26.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index27.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index28.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index29.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index30.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index31.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index32.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index33.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index34.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index35.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index36.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index37.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index38.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index39.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index40.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index41.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index42.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index43.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index44.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index45.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index46.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index47.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index48.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index49.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index50.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index51.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index52.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index53.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index54.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index55.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index56.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index57.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index58.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index59.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index60.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index61.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index62.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index63.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index64.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index65.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index66.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index67.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index68.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index69.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index70.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index71.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index72.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index73.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index74.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index75.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index76.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index77.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index78.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index79.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index80.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index81.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index82.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index83.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index84.htm']"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url_group = ['https://www.nfu.edu.cn/xydt/index'+str(i)+'.htm' for i in range(1,85)]\n",
    "url_group"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['https://www.nfu.edu.cn/xydt/index1.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index2.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index3.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index4.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index5.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index6.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index7.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index8.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index9.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index10.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index11.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index12.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index13.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index14.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index15.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index16.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index17.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index18.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index19.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index20.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index21.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index22.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index23.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index24.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index25.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index26.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index27.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index28.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index29.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index30.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index31.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index32.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index33.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index34.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index35.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index36.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index37.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index38.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index39.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index40.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index41.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index42.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index43.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index44.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index45.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index46.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index47.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index48.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index49.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index50.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index51.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index52.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index53.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index54.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index55.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index56.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index57.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index58.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index59.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index60.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index61.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index62.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index63.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index64.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index65.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index66.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index67.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index68.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index69.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index70.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index71.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index72.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index73.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index74.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index75.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index76.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index77.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index78.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index79.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index80.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index81.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index82.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index83.htm',\n",
       " 'https://www.nfu.edu.cn/xydt/index84.htm']"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url_group = ['https://www.nfu.edu.cn/xydt/index'+str(i)+'.htm' for i in range(1,85)]\n",
    "url_group"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "for url in url_group:\n",
    "    r = session.get(url)\n",
    "#     print(r.html.html)\n",
    "#     设置存档HTML的名称\n",
    "    path = urllib.parse.urlparse(url).path\n",
    "    with open ('html_out/'+path, encoding = \"utf8\", mode = \"w\") as fp:\n",
    "        fp.write(r.html.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# xpath 准备：\n",
    "dict_xpath = {\n",
    "    '链接_xpath':'//div[@class=\"news_title\"]/a/@href',\n",
    "    '标题_xpath':'//div[@class=\"news_title\"]/a/@title',\n",
    "    '日期_xpath':'//font[@class=\"right-more\"]/text()'\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "def pages_content_url(parsed):\n",
    "    list_URL  = [urllib.parse.urlunparse\\\n",
    "                 ([nfu_urlparse.scheme,nfu_urlparse.netloc,'/'+ nfu_urlparse.path.split('/')[1] +'/' + detail_url,'','',''])\\\n",
    "                 for detail_url in parsed.xpath(dict_xpath['链接_xpath'])]\n",
    "    return list_URL"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['index1.htm', 'index10.htm', 'index11.htm', 'index12.htm', 'index13.htm', 'index14.htm', 'index15.htm', 'index16.htm', 'index17.htm', 'index18.htm', 'index19.htm', 'index2.htm', 'index20.htm', 'index21.htm', 'index22.htm', 'index23.htm', 'index24.htm', 'index25.htm', 'index26.htm', 'index27.htm', 'index28.htm', 'index29.htm', 'index3.htm', 'index30.htm', 'index31.htm', 'index32.htm', 'index33.htm', 'index34.htm', 'index35.htm', 'index36.htm', 'index37.htm', 'index38.htm', 'index39.htm', 'index4.htm', 'index40.htm', 'index41.htm', 'index42.htm', 'index43.htm', 'index44.htm', 'index45.htm', 'index46.htm', 'index47.htm', 'index48.htm', 'index49.htm', 'index5.htm', 'index50.htm', 'index51.htm', 'index52.htm', 'index53.htm', 'index54.htm', 'index55.htm', 'index56.htm', 'index57.htm', 'index58.htm', 'index59.htm', 'index6.htm', 'index60.htm', 'index61.htm', 'index62.htm', 'index63.htm', 'index64.htm', 'index65.htm', 'index66.htm', 'index67.htm', 'index68.htm', 'index69.htm', 'index7.htm', 'index70.htm', 'index71.htm', 'index72.htm', 'index73.htm', 'index74.htm', 'index75.htm', 'index76.htm', 'index77.htm', 'index78.htm', 'index79.htm', 'index8.htm', 'index80.htm', 'index81.htm', 'index82.htm', 'index83.htm', 'index84.htm', 'index9.htm']\n"
     ]
    }
   ],
   "source": [
    "import os     # 读取html文件\n",
    "\n",
    "list_df = []\n",
    "\n",
    "\n",
    "files= os.listdir('html_out/xydt/')\n",
    "print(files)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['index1.htm', 'index10.htm', 'index11.htm', 'index12.htm', 'index13.htm', 'index14.htm', 'index15.htm', 'index16.htm', 'index17.htm', 'index18.htm', 'index19.htm', 'index2.htm', 'index20.htm', 'index21.htm', 'index22.htm', 'index23.htm', 'index24.htm', 'index25.htm', 'index26.htm', 'index27.htm', 'index28.htm', 'index29.htm', 'index3.htm', 'index30.htm', 'index31.htm', 'index32.htm', 'index33.htm', 'index34.htm', 'index35.htm', 'index36.htm', 'index37.htm', 'index38.htm', 'index39.htm', 'index4.htm', 'index40.htm', 'index41.htm', 'index42.htm', 'index43.htm', 'index44.htm', 'index45.htm', 'index46.htm', 'index47.htm', 'index48.htm', 'index49.htm', 'index5.htm', 'index50.htm', 'index51.htm', 'index52.htm', 'index53.htm', 'index54.htm', 'index55.htm', 'index56.htm', 'index57.htm', 'index58.htm', 'index59.htm', 'index6.htm', 'index60.htm', 'index61.htm', 'index62.htm', 'index63.htm', 'index64.htm', 'index65.htm', 'index66.htm', 'index67.htm', 'index68.htm', 'index69.htm', 'index7.htm', 'index70.htm', 'index71.htm', 'index72.htm', 'index73.htm', 'index74.htm', 'index75.htm', 'index76.htm', 'index77.htm', 'index78.htm', 'index79.htm', 'index8.htm', 'index80.htm', 'index81.htm', 'index82.htm', 'index83.htm', 'index84.htm', 'index9.htm']\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>标题</th>\n",
       "      <th>链结</th>\n",
       "      <th>日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>凝聚共识谋规划， 师生同心促发展—— 电气与计算机工程学院召开全体教职工大会</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/76d9a219517e4a2b8c...</td>\n",
       "      <td>2021-03-25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>护理与健康学院“开卷行之”征文比赛圆满结束</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/bf6e98d6027544809e...</td>\n",
       "      <td>2021-03-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>青春心向党，奋进新时代——护理与健康学院院长“思政第一课”顺利开讲</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/874bf131af7746d888...</td>\n",
       "      <td>2021-03-23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>护理与健康学院召开2021年春季工作会议</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/30f39cccbda84ecb92...</td>\n",
       "      <td>2021-03-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>广州南方学院教育实践基地签约挂牌仪式暨2021年良口中学第一期课程开班仪式</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/7f86c7803e7c440883...</td>\n",
       "      <td>2021-03-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1642</th>\n",
       "      <td>2</td>\n",
       "      <td>文学与传媒系2016年学术研讨会议成功举办</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/ae2cf68f6b1247a6a1...</td>\n",
       "      <td>2016-01-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1645</th>\n",
       "      <td>5</td>\n",
       "      <td>严谨为学，诚信迎考--工商管理系班级期末总结暨诚信考试动员大会圆满结束</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/3d02b255690e4ce796...</td>\n",
       "      <td>2016-01-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1644</th>\n",
       "      <td>4</td>\n",
       "      <td>经济学与商务管理系顺利召开办公培训会议</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/9b59863e5051412d80...</td>\n",
       "      <td>2016-01-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1646</th>\n",
       "      <td>6</td>\n",
       "      <td>以学生为本，做优秀学生干部——我院“青马工程”第二讲举行</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/0132532dbb0e448d82...</td>\n",
       "      <td>2015-10-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1647</th>\n",
       "      <td>7</td>\n",
       "      <td>经济学与商务管理系党总支第17期入党积极分子实践活动圆满结束</td>\n",
       "      <td>https://www.nfu.edu.cn/xydt/2d20a911787b4cc09c...</td>\n",
       "      <td>2015-03-28</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1668 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      index                                      标题  \\\n",
       "0         0  凝聚共识谋规划， 师生同心促发展—— 电气与计算机工程学院召开全体教职工大会   \n",
       "1         1                   护理与健康学院“开卷行之”征文比赛圆满结束   \n",
       "2         2       青春心向党，奋进新时代——护理与健康学院院长“思政第一课”顺利开讲   \n",
       "3         3                    护理与健康学院召开2021年春季工作会议   \n",
       "4         4   广州南方学院教育实践基地签约挂牌仪式暨2021年良口中学第一期课程开班仪式   \n",
       "...     ...                                     ...   \n",
       "1642      2                   文学与传媒系2016年学术研讨会议成功举办   \n",
       "1645      5     严谨为学，诚信迎考--工商管理系班级期末总结暨诚信考试动员大会圆满结束   \n",
       "1644      4                     经济学与商务管理系顺利召开办公培训会议   \n",
       "1646      6            以学生为本，做优秀学生干部——我院“青马工程”第二讲举行   \n",
       "1647      7          经济学与商务管理系党总支第17期入党积极分子实践活动圆满结束   \n",
       "\n",
       "                                                     链结          日期  \n",
       "0     https://www.nfu.edu.cn/xydt/76d9a219517e4a2b8c...  2021-03-25  \n",
       "1     https://www.nfu.edu.cn/xydt/bf6e98d6027544809e...  2021-03-24  \n",
       "2     https://www.nfu.edu.cn/xydt/874bf131af7746d888...  2021-03-23  \n",
       "3     https://www.nfu.edu.cn/xydt/30f39cccbda84ecb92...  2021-03-22  \n",
       "4     https://www.nfu.edu.cn/xydt/7f86c7803e7c440883...  2021-03-22  \n",
       "...                                                 ...         ...  \n",
       "1642  https://www.nfu.edu.cn/xydt/ae2cf68f6b1247a6a1...  2016-01-08  \n",
       "1645  https://www.nfu.edu.cn/xydt/3d02b255690e4ce796...  2016-01-04  \n",
       "1644  https://www.nfu.edu.cn/xydt/9b59863e5051412d80...  2016-01-04  \n",
       "1646  https://www.nfu.edu.cn/xydt/0132532dbb0e448d82...  2015-10-30  \n",
       "1647  https://www.nfu.edu.cn/xydt/2d20a911787b4cc09c...  2015-03-28  \n",
       "\n",
       "[1668 rows x 4 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import os\n",
    "\n",
    "list_df = []\n",
    "\n",
    "# os listdir取出某文件夹中的文件的名称组成列表\n",
    "files= os.listdir('html_out/xydt/')\n",
    "print(files)\n",
    "\n",
    "for html in files:\n",
    "    with open('html_out/xydt/'+html,encoding='utf8',mode='r') as fp:\n",
    "        html_load = fp.read()\n",
    "        parsed = requests_html.soup_parse(html_load)\n",
    "        list_URL = pages_content_url(parsed)\n",
    "        \n",
    "        df = pd.DataFrame( {\n",
    "         \"标题\": parsed.xpath(dict_xpath['标题_xpath']),\n",
    "         \"链结\": list_URL,\n",
    "         \"日期\": parsed.xpath(dict_xpath['日期_xpath']),\n",
    "        } )\n",
    "        list_df.append(df)\n",
    "\n",
    "\n",
    "# 凭借表格pandas 方法concat\n",
    "# 数据分析的方法 concat拼接DataFrame  sort_values排序\n",
    "df_all = pd.concat(list_df).reset_index().sort_values(by='日期',ascending=False)\n",
    "display(df_all)    \n",
    "\n",
    "with pd.ExcelWriter('data_out/nfu_校园动态.xlsx',mode='w',engine=\"openpyxl\") as writer:  \n",
    "            df_all.to_excel(writer, sheet_name='校园动态')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
